//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Vml
{
    class ReColorInfoEntry: IOfficeXmlSerializable
    {
        private string fromcolor;
        private string tocolor;
        internal const string xmlName = "recolorinfoentry";
        //tocolor="schemeTitle" fromcolor="rgb(0,0,0)"
        /// <summary>
        /// Generates an object from its XML representation
        /// </summary>
        /// <param name="context"></param>
        public void ReadXml(ReadContext context)
        {
            using (var c = context.Read(xmlName))
            {
                this.tocolor = c.GetOptionalString("tocolor");
                this.fromcolor = c.GetOptionalString("fromcolor");
            }
        }

        /// <summary>
        /// Convert an object into its XML representation
        /// </summary>
        /// <param name="context"></param>
        public void WriteXml(WriteContext context)
        {
            using (var c = context.Write(xmlName))
            {
                c.SetOptionalString("tocolor", tocolor );
                c.SetOptionalString("fromcolor", fromcolor );
            }
        }
    }
}